package org.example.erat.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class StudentManager {
    private final Map<String, Student> students = new HashMap<>();

    public void addStudent(Student student) {
        students.put(student.getStudentId(), student);
    }

    public void addStudents(List<Student> students) {
        students.forEach(this::addStudent);
    }

    public void removeStudent(String studentId) {
        students.remove(studentId);
    }

    public Student getStudent(String studentId) {
        return students.get(studentId);
    }

    public List<Student> getAllStudents() {
        return new ArrayList<>(students.values());
    }

    public boolean containsStudent(String studentId) {
        return students.containsKey(studentId);
    }
}    